Field of the Invention
The present invention relates to a method and a system for managing a database, and more particularly to a method and a system for managing a database which are capable of improving a data processing speed.
Discussion of the Background
A database management system (DBMS) is a system for managing a database that stores massive amounts of data and is regarded as being essential in an age in which copious amounts of information are being generated continuously.
The DBMS stores all data in a database in a tabular format. Here, a table refers to a basic structure in which a database stores data and one table includes at least one record.
A record indicates one row of a table and may also be referred to as a tuple. Each record includes at least one column. A column refers to a domain having a name representing a category of a table in a real world, which is also referred to as an attribute or a field.
When a query is input from an external source, the DBMS selects, inserts, updates, or deletes data of the database based on the query.
Here, a query refers to a request made with respect to data stored in a table of a database, describing a process which is desired to be implemented to the data. A query is expressed using a structured query language (SQL) or the like.
Among SQL queries, a representative query is a select statement. The select statement is used to read data in a table, to analyze data to revise the content of the data, or to read desired data with reference being made to data distributed in different tables.
For example, in an SQL statement “SELECT*FROM board WHERE id=10”, a SELECT statement denotes a request to demand selection of records corresponding to all columns satisfying “id=10”, that is, tuples corresponding to all columns, from a table “board.”
When the abovementioned query is input, the DBMS generates an execution plan to determine data extraction methods and procedures in order to extract the data requested by the input query. A conventional DBMS generates a new execution plan for each query whenever a query is input and extracts data based on the generated execution plan.
However, when a query substantially the same as a first query previously input or a second query which has a different particular condition only, e.g., a different execution value list, is input, even though an execution plan for the second query is nearly the same as an execution plan for the first query, the conventional DBMS newly generates the execution plan for the second query, thereby reducing efficiency in managing the system.
Further, when a second query which is substantially the same as the first query previously input is input, the conventional DBMS generates a query result separately with respect to the second query through execution of an execution plan for the second query instead of using a query result with respect to the first query, which is an inefficient method.